<script>
  let name = 'Nicholas';
  let age = 36;
</script>

<script>
  // Suppose this script is unsure about what has already been declared in the page. 
  // It will assume variables have not been declared.

  if (typeof name !== 'undefined') {
    let name;
  }
  // 'name' is restricted to the if {} block scope,
  // so this assignment will act as a global assignment
  name = 'Matt';


  try (age) {
    // If age is not declared, this will throw an error
  }
  catch(error) {
    let age;
  }
  // 'age' is restricted to the catch {} block scope,
  // so this assignment will act as a global assignment
  age = 26;
</script> 
